package com.xiangwei.util;

import java.util.HashMap;
import java.util.Map;

public class PageUtil {
	
	/**
	 * 分页信息类
	 * @param pageSize
	 * @param allCount
	 * @param currentPage
	 * @return
	 */
	public static Map<String,Object> getPage(Integer pageSize, Integer allCount, Integer currentPage){
		
		Integer pageCount = 0;          //总页数
		pageCount = allCount/pageSize;
		if(allCount%pageSize>0){   //如果总数除以每页显示的数量，有余数，就总页数再加一页
			pageCount++;
		}
		Map<String,Object> list = new HashMap<String,Object>();
		list.put("pageSize",pageSize);
		list.put("allCount",allCount);
		list.put("currentPage",currentPage);
		list.put("pageCount",pageCount);
		
		return list;
		
	}
	
	public static void main(String[] args){
		System.out.println(1/2);
	}

}
